Method and apparatus for encoding and decoding digital video data

ABSTRACT

The bit rate control goals for applications using storage devices with the capability to process a variable bit rate data stream differ from the constant bit rate case. Therefore the encoder control strategy is adapted to this situation. For the first e.g. 80% of the total playing time an average bit rate is produced which is e.g. 95% only of the normal average bit rate. For the remaining 20% of the playing time the value for the desired average bit rate ascends to e.g. 150% of the normal value. During the first 80% the virtual buffer size is increased by a factor of e.g. 100 whereas during the last 20% the virtual buffer size descends to the normal value. Thereby an increased decoding quality can be achieved during e.g. 80% of the playing time. In the remaining playing time there is nearly no loss in the normal decoding quality.

FIELD OF THE INVENTION

The present invention relates to a method and to an apparatus forencoding and decoding digital video data for and from, respectively,storage media having a given data storage capacity.

BACKGROUND OF THE INVENTION

ISO/IEC 13818 “Information Technology—Generic coding of moving picturesand associated audio information: Video” (MPEG2) discloses anInternational standard concerning coded digital video and audio datastreams. Due to varying picture content the generated amount of codevaries over time. However, in case of fixed channel capacity normally aconstant bit rate (CBR) MPEG encoder control is desired which can beachieved by using an encoder buffer at transmission side and a decoderbuffer at receiver side which is explained in more detail in annexes Cand D.4 of said International standard. The other mode is variable bitrate (VBR) coding.

SUMMARY OF THE INVENTION

If there is any digital storage medium like DVD (digital video disc)which is capable of variable bit rate operation it might be possible toimprove the coding quality by using variable bit rate coding instead ofconstant bit rate coding.

It is one object of the invention to disclose a method of variable bitrate encoding for a fixed-capacity storage medium in which the codingquality is basically improved compared to that of constant bit rateencoding.

It is a further object of the invention to disclose a method of variablebit rate decoding from a fixed-capacity storage medium in which thedecoding quality is basically improved compared to that of constant bitrate decoding.

It is a further object of the invention to disclose an encoding and adecoding apparatus which utilises the inventive encoding and decodingmethod, respectively.

It is a further object of the invention to disclose a digital videosignal which is encoded or decoded according to the inventive method.

“Constant bit rate” shall mean a constant number of bits output to thechannel (or e.g. the Systems multiplexer) in each field period (2 Oms ina 50 Hz TV signal), while “variable bit rate” shall cover all other bitdelivery schedules. In a CBR environment the kernel MPEG encoder circuitis followed by a buffer of a certain size. This buffer is used to smooththe inherently variable bit rate output of the kernel MPEG encoder. Thevideo buffering verifier VBV is a concept used in encoder control thatgives an upper bound for the usable encoder buffer size as well as theminimum buffer size needed by a decoder to decode all bit streamscompliant to this profiles @ levels (P@L). For all defined profiles @levels maximum VBV_buffer_size values are specified in clause 8 ofISO/IEC 13818-2. Smaller values are also allowed and can be signalled ineach bitstream by the VBV_buffer_size element. In a variable bit rateapplication there is no urgent need to use the encoder buffer to smooththe bit rate, however, it might still be useful to retain the buffer, aswill become evident below. So the change is that the channel bit rate isvariable now.

In both, CBR and VBR applications, the MPEG encoder and the MPEG decoderoperate by using the well-known hybrid DPCM/DCT structures.

The bit rate control goals for applications using storage devices withthe capability to process a variable bit rate data stream differ fromthe CBR case. It can now be desirable to:

maintain uniform quality over time;

maximise storage time on a medium of a given capacity.

Therefore the encoder control strategy needs to be adapted to thissituation.

To ease understanding the encoder control for the CBR case shall bereviewed first.

The conventional encoder control strategy consists of three steps orcontrol levels:

1) bit allocation (global control):

The allocation of bits to the different coded frame types (I, P, Bframes) is determined according to their relative complexity X_(i),X_(p), X_(b). The goal is to equalise the subjective quality of theframe types. In the following feedback implementation, which does notcarry out any pre-analysis, it is assumed that video scenes aresufficiently stationary for some time, so that information from the pastframes can be used for the bit allocation to the coming frame or field,depending on the coding structure. In the remainder of thespecification, “frame” may generally denote a frame or a field or anyother section of a GOP which is greater than a unit (to be definedbelow).

The complexity can be estimated by any criterion reflecting the relativecoding cost for I, P, and B frames at a given image quality. However, itshould be considered whether the necessary measurements can be obtainedwithout too much burden on the encoder complexity.

First the “image quality” should be measured. However, it is well knownthat no commonly agreed, sufficiently simple, objective measure exists.Therefore, usually the signal-to-noise ratio (SNR) of the reconstructedframe is taken as an approximation to image quality. In the context ofan MPEG encoder control even this measure is somewhat costly as itinvolves computation of SNR for each encoded frame. Therefore theaverage quantiser step size (Q_(i), Q_(p), Q_(b)) used to code a frameis taken as a quality indicator instead.

Now, having defined a measure for “quality”, the “complexity” of a framecan be expressed as the product of bits generated and the quantiser stepsize used. In other words: a frame is complex to code if it producesmany bits even if the quantiser step size is coarse. This product isformed for each unit m (e.g. macroblock or block or slice or any sectionwhich is smaller than a frame) and then summed over the frame:

x_(m)=b_(m)*q_(m)  (1a)

X_(c)=Εx_(m),  (1b)

wherein b_(m) is the number of bits for coding unit m, q_(m) is theaverage quantiser step size used in unit m, and c=i, p or b is thecoding type.

At the beginning of each Group Of Pictures GOP the bit budget B_(G)(g)available for the current GOP g, considering also a carry B_(G)(g−1)from the previous GOP, is

B _(F)(n32 0)=B _(G)(g)=(bit rate)*(frames per GOP)/(frame rate)−B_(G)(g−1)  (2)

For each frame n in the current GOP, a target number of bits T_(c),depending on its coding type c, is determined according to the computedcomplexity and the remaining number of frames of each coding type(N_(i), N_(p), N_(b)) within the current GOP.

Considering the remaining bits B_(F)(n) after coding frame n−1 of theGOP, the following formula can be used:

T _(c) =B _(F)(n)*(X _(c) *K _(c))/(N _(i) *X _(i) *K _(i) +N _(p) *X_(p) *K _(p) +N _(b) *X _(b) *K _(b))  (3)

The factors K_(c) are used to reflect different visual importance offrame coding types, typically K_(i)=K_(p)=1 and K_(b)<1.

The complexity computation according to equations (1a) and (1b) isnormally updated after each frame, using data from the most recent I, Pand B frames, to ensure a reasonable response to scene changes. The bitbudget

B _(F)(n+1)=B _(F)(n)−Εb _(m)  (4)

for the remaining frames of the GOP, after subtracting the number ofbits Εb_(m) used for the current frame, is re-distributed using formula(3) with N_(i), N_(p), N_(b) set to the remaining number of frames ofeach type.

After coding the last frame N of the GOP, the remaining bitsB_(G)(g)=B_(F)(N) are carried to the next GOP g+1.

It is also possible to explicitly allow a non-constant amount of bitsper GOP, keeping only the long-time average bit rate constant.Practically this can be implemented by re-filling the bit budgetB_(F)(n) after each frame using

B _(F)(n)=B _(F)(n−1)−Εb _(m)+(bit rate)/(frame rate)  (5)

instead of re-filling the budget only at the start of a GOP usingequation (2). This budget will then always be distributed according tothe number of I, P and B frames in a GOP, rather than only on theremaining frames in the current GOP. The effect of this change in caseof a scene change in the middle of a GOP is that a scene change P framemight obtain more bits which improves its quality. However, due to VBVfullness and/or the reduced bit budget, most probably the next regular Iframe will not get as many bits as it should, hereby decreasing thequality of the whole next GOP. Therefore, preferably, the “constant bitbudget per GOP” notion is used for CBR applications.

A minimum bit budget is needed for each frame to be able to encode atleast the overhead information. This is most important for B frames thattend to be least complex, therefore getting allocated very few bits. CBRrate control may use fixed minimum bit budgets, however, an estimationof the necessary overhead bit budget could also be made based on thepast frames.

The maximum number of bits that can be allocated to a frame (usually anI frame) is bound by the status of the VBV. No more than VBV_buffer_sizebits can be consumed by a single frame, given an initially empty encoderbuffer.

2) buffer control (local control):

For each individual frame the bit production is controlled to be withinsome range of the allocated target number of bits, using a virtualbuffer concept, that corresponds to a P-controller in control theory.This is depicted in FIG. 5. The virtual buffer VBU_(c) is filled fromthe difference e_(m) between the bits b_(m) generated by each unit(macroblock) in the MPEG2 encoder MEN, and from the portion of thetarget for this unit, t_(m)=T_(c)/M, where M is the number of units perframe. Independent virtual buffers VBU_(c) with a possibly differentsize V_(co) are used for each frame coding type c=i, p, b, sincedifficulties in matching the target for one frame type should notpropagate to other frame types. The status d_(m) of the virtual bufferVBU_(c) at the end of a frame is propagated as d_(o) to the next frameof the same coding type:

d _(m) =d _(o)+Ε(b _(m) −t _(m))  (6)

For each unit m a quantiser step size q_(m) is computed in calculatingmeans QC from the fullness of this virtual buffer d_(m) relative to itssize V_(co).

The so-called “non-linear quantiser” table, see table 7-6 in ISO/IEC13818-2, (which does not refer to non-linear quantisation) is used toobtain a sufficiently progressive non-linear mapping of the available 31codewords for quantiser_scale_code to actual quantiser step sizes q_(m).quantiser_scale_code can be simply set to 32 * d_(m)/V_(co). The verycoarse quantisation available with this table can be used to deal with“panic” situations when the buffer is close to full. The size of thevirtual buffer, V_(co), which in control theory is called “reaction”parameter of the P-controller, determines the tightness of control. Itcan be made very large (even larger than the VBV) if it is acceptablethat the number of bits generated deviates much from the target.

A large virtual buffer can be used, e.g., for P frames, since it is notknown a priori whether a scene change will occur in the current GOP. Incase of scene change the bit production can be unpredictably high.However, this will result in impaired quality only in such cases wherethe virtual buffer is filled to such extend that the quantiser step sizeis drastically increased.

Advantageously, the reaction to an unpredicted high bit production isdelayed as much as possible, while an unpredicted low bit productionshould result in immediate reduction of the quantiser step size. Thiscan be realised by different reaction parameters V_(co), Vd_(co), (i.e.virtual buffer size), which e.g. depend on the relation between thevirtual buffer fullness d_(m) when coding unit m and the initialfullness d_(o) at the start of a frame, using:

if d_(m)>d_(o)

quantiser_scale_code=32*d_(m)/V_(co),

else

quantiser_scale_code=32*(d _(o) V _(co)−(d _(o) −d _(n))/Vd _(co)).  (7)

Vd_(co), which is the reaction when d_(m) is going down, should be smallcompared to V_(co). q_(m) is derived again by a look-up in table 7-6 ofISO/IEC 13818-2.

The status of the VBV should be monitored in addition to the controlbased on the virtual buffers, especially if control is “loose”, i.e. thevirtual buffers are big. While the target for a frame as well as thetarget for a whole GOP may be exceeded, the VBV, representing thedecoder physical buffer, may never under- or overflow.

Furthermore MPEG disallows frequent occurrence of units (macroblocks)that exceed a certain number of bits (ISO/IEC 13818-2, table 8-6). Thishas to be monitored and controlled as well.

3) content adaptive quantisation:

To reflect the varying local complexity of different parts of an image,a local complexity measure for each unit can be computed. Currently thisis derived from the AC energy of the luminance blocks of the unit.

The complexity factor obtained is used to modify the previously computedquantiser step size to some extend, e.g. by a factor in the range 0.5 to2.0. Only this final quantiser step size information (coded asquantiser_scale_code) is transmitted in the bitstream each time it isdifferent from that for the previous unit (macroblock). The aim is todistribute bits in such a way that the subjective quality within theframe is homogenous. Alternative schemes exploiting the properties ofthe human visual system to that end can be applied here.

Preferably, control level 3) is disabled in case of coarse quantisationsince otherwise no strict control of bit generation is possible.

Advantageously, if the bit allocation in level 1) is successful, level2) should maintain a mostly constant virtual buffer status, i.e. aconstant quantiser step size, throughout a frame.

However, the bit allocation can fail and/or the complexity can bedistributed very inhomogeneously within the frame, so that in practicethis will never be completely true.

Another reason for sub-optimum performance of the control scheme is thefact that the complexity values computed in step 1) are not constant fora given image, but they depend on the quantisation step size in a waythat cannot easily be modelled. This is depicted in FIG. 6, showing thecomplexity X over quantiser step size Q for I frames of 12 differentsequences. When coding natural picture sequences one can observe somedegree of oscillation in bit allocation for subsequent P frames,although the scene was completely temporally homogeneous.Advantageously, this behaviour can be avoided if a complexity measure isused that is independent of the applied quantiser step size.

In VBR applications the following additional considerations must bemade, beginning with the encoder and decoder buffers.

As mentioned above, physical buffers are advantageous even in the VBRcase. The reason for this is the huge amount of bits produced by Iframes compared to other frame types. When encoding standard TV pictures(CCIR 601 resolution) at a reasonable quality with CBR, e.g. at 5Mbit/s, a typical instantaneous data rate for an I frame can be morethan 15 Mbit/s, with “instantaneous data rate” defined as (bitsgenerated by a frame)/(one frame period).

As long as the peak data rate of the storage device is below this value,a buffer is still necessary to be able to achieve higher quality withVBR than with CBR coding. The VBV_buffer_size of 1.75 Mbit for MainProfile @ Main Level will limit the peak instantaneous data rate to e.g.a more than sufficient 45 Mbit/s rate assuming an initially emptybuffer. Advantageously, the VBR output of the encoder buffer and the VBRinput of the decoder buffer can be modelled as leaky buckets. Dataalways leaks at the peak rate of the channel. It leaks out of theencoder buffer as long as data is present in it, while it leaks into thedecoder buffer as long as it is not full.

For control purposes the physical buffer status can be monitored onceper frame (field) period only. However, this means that a buffer portionof the size [(peak data rate)/(frame period)] is needed to cope with apossible unequal bit production during the frame period. This furtherlimits the peak instantaneous data rate. Advantageously, buffer controlon a unit by unit (macroblock by macroblock) basis can be used to avoidthis situation.

A VBR control should reach the following goals:

As postulated at the beginning a VBR encoder control should be moretargeted to equalising the quality over the whole duration of arecording on the storage medium. Especially, bits should not be spentunless an additional (visible) gain in quality can be expected. From therate control point of view, two scenarios can be distinguished.

Scenario 1) Fit a maximum duration of video on a storage medium of givencapacity:

A sufficient quality can be selected by the application designer bysetting the quantiser step size from control step 2) to an appropriatevalue. The content adaptive quantisation of step 3) should still bedone, since it addresses the subjective quality harmonisation withineach frame. In fact, improvements in this area are possible if visionmodels are used that better reflect the artefact visibility by a humanobserver.

Rate control is now necessary only to avoid overflow of the encoderbuffer. Underflow will not occur in a VBR application, since thevariable channel data rate is allowed to be zero temporarily.

Scenario 1a) Guaranteed minimum duration of video:

Using a rate control as described in scenario 2) below, it wouldfurthermore be possible to guarantee a minimum recording duration on themedium. Depending on the complexity of the video, the recording durationcan also be higher than this minimum.

Scenario 2) Fit a video of given duration on a medium of given capacity:

Again, it is assumed that there is no a priori analysis of thecomplexity distribution throughout the video material. As long as thereis no complexity measure available that is independent from thequantiser step size and that can be derived from variables that arereadily available from a reasonably low cost encoder, control solutionsto equalise the video quality throughout its duration have to use someheuristics and will not be optimum.

The basic idea for a VBR control approach is to have a very loosecontrol with varying bit rate at the beginning, while control becomestighter when the end of the capacity of the storage medium is approachedor when the remaining duration of the picture material to be coded issuch that a pre-selected minimum bit rate can not be guaranteedthroughout this remaining duration.

It should be noted, however, that this approach privileges the beginningof a recording, that can now exhibit constant quality, while a constantrate with possibly lower quality is enforced toward the end.

Advantageously, this disadvantage can be remedied to some extent if theconstant bit rate R_(e) that is used toward the end of the recording isselected to be higher than the average bit rate R_(avg) for the wholerecording. That average bit rate can be computed as

R_(avg)=B/T  (8)

with B being the total storage medium capacity and T the video materialduration.

Advantageously, this bit rate R_(e) is chosen such that most videocontent at the end exhibits acceptable quality while the quality for thefirst part of the recording is still better than in case of CBR codingof the whole recording.

So, from the above, for each kind of recording the unknown variables arethe quantiser step size at the start of the encoding and the constantbit rate R_(e) toward the end. Unfortunately, it is not easily possibleto find a suitable quantiser step size to start with, since withoutknowledge about the complexity of a video it is difficult to estimateits bit production at a given quantiser step size.

Furthermore, it is somewhat messy to build a control scheme thatmonitors the physical buffer fullness at all times and allows thetransition from constant quantiser to constant rate operation. Thistransition depends on the amount of bits produced until a point in timet as well as on the duration that remains to be encoded. Earlyproduction of an unproportionately high amount of bits as well as ashort remaining duration are indicators for the need of tight ratecontrol.

Therefore, the following modified rate control scheme is proposed:

It is preferable to keep the bit rate controlled during the wholerecording. By having a very loose control (=very big virtual buffers)and by removing the constant bit budget B_(G)(g) per GOP at thebeginning it is possible to allow rather large variations ininstantaneous bit rate (i.e. a quasi-constant quantiser step size) sothat at least scene changes and difficult scenes of a duration of acouple of seconds will benefit from this loose control.

For this purpose it is necessary to define the behaviour change of therate control scheme over time.

First, reasonable values for the average bit rate at the beginning andat the end of the recording need to be defined. Taking R_(avg) as theaverage bit rate for this recording, computed as in equation (8), it isadvantageous to have for instance:

R_(start)=0.95*R_(avg)  (9a)

R_(end)=1.5*R_(avg),  (9b)

considering that 0.95 times the average bit rate would in the worst caselead to a negligible loss if the whole picture sequence has a constantcomplexity over time, while 1.5 times the average bit rate at the end issufficient to properly code most worst case picture content if ithappens to occur just at the end.

Over the whole time (with a linear transition from R_(start) to R_(end))R_(avg) can be regarded as composed of

R _(avg) =R _(start)*τ₁+0.5*(R _(start) +R _(end))τ₂ +R_(end))*τ₃  (10a)

with the time periods τ₁, τ₂, and τ₃ normalised to be

τ₁+τ₂+τ₃=1 (total time of storage medium)  (10b)

With the above assumptions it is necessary to select one more parameter.Setting τ₃ to 0.01 reflects the fact, that precise control of theoverall bit production can be re-established in a very short time. Givene.g. one hour video duration T this corresponds to τ₃*T=36 seconds. τ₃can be regarded as an overall bit number adaptation period. Solving theequations (9a) to (10b) yields

Ε₁=0.79 and Ε₂=0.20.

With these figures loose control will occur during about 79% of therecording time while the transition phase takes about 20% of the totaltime. Other transition characteristics can be implemented that increasethe percentage of time with loose control even more.

The time variant parameters of the rate control can now be describedusing $\begin{matrix}{\alpha = \left\{ \begin{matrix}{0,} & {\tau < \tau_{1}} \\{{\left( {\tau - \tau_{1}} \right)/\left( {\tau_{2} - \tau_{1}} \right)},} & {\tau_{1} \leq \tau \leq \tau_{2}} \\{1,} & {\tau > \tau_{2}}\end{matrix} \right.} & (11)\end{matrix}$

Other transition characteristics for α can be implemented between timeinstants Ε₁ and τ₂.

The bit rate used for step 1) of the rate control now is

R(τ)=(1−α)*R _(start) +α*R _(end)  (12)

The virtual buffer sizes V_(co), c=i,p,b, are advantageously modified tobe

V _(c)(τ)=((1−α)*V _(huge)+α)*V _(co)  (13)

For example, an increase in size of V_(huge)=100 can be used. These hugevirtual buffers corresponding to a very slow reaction are intentionalfor short time intervals of complex picture material. However, it is notdesirable that a non-complex part of the video following a long complexpart could now be coded with a very coarse quantiser step size. It istherefore necessary to use the above mentioned idea of a quickerreaction parameter in case the bit production (=the virtual bufferstatus) decreases more than predicted, i.e. falls below the target. Thisparameter, Vd_(c), might also be time variant according to

Vd _(c)(τ)=((1−α)*Vd _(huge)+α)*Vd _(co),  (14)

but as initial guess Vd_(huge)=1 is proposed, since during the wholeduration a fast reaction is desirable in this case. Advantageously, there-filling of the bit budget B_(F)(n) is now carried out not only onceper GOP. Refill per frame n:

B _(F)(n)=B _(F)(n−1)+(1−α)*R(τ)/(frame rate)

Refill per GOP g:

B _(F)(n=0)=B _(G)(g)=α*R(τ)*(frames per GOP)/(frame rate)+B _(G)(g−1)

Apart from the emptying of the encoder buffer and, hence, the VBV as aleaky bucket, as described before, these can be the only changes thatneed to be made to the CBR rate control as described in the first partof the specification.

In principle, the inventive method of encoding digital video data issuited for storage on memory or recording means having a given datastorage capacity and allowing a variable instantaneous storage bit rate,whereby

for a first part of said storage capacity the data is encoded using aslightly less than average bit rate and a significantly more loose thanaverage bit rate control;

for a second part of said storage capacity the data is encoded using ahigher than average bit rate and a tight bit rate control.

In principle, the inventive method is suited for decoding digital videodata stored on memory or recording means having a given data storagecapacity and allowing a variable instantaneous reading bit rate intodecoding buffer means, whereby

during a first part of said storage capacity the data is decoded using aslightly less than average decoder buffer means input bit rate andsignificantly higher than average allowable buffer filling levelvariations;

during a second part of said storage capacity the data is decoded usinga higher than average decoder buffer means input bit rate and less thanaverage allowable buffer filling level variations.

Advantageous additional embodiments of the inventive methods areresulting from the respective dependent claims.

In principle the inventive apparatus is suited for encoding digitalvideo data for storage on memory or recording means having a given datastorage capacity and allowing a variable instantaneous storage bit rate,using an encoding loop including discrete cosine transform means,quantiser means, inverse quantiser means, inverse discrete cosinetransform means, picture store means, and entropy encoding meansdelivering the encoded output signal and being connected to the outputof said quantiser means, wherein said quantiser means, said inversequantiser means, and said entropy encoding means are controlled in thefollowing way:

for a first part of said storage capacity the data is encoded using aslightly less than average bit rate and a significantly more loose thanaverage bit rate control;

for a second part of said storage capacity the data is encoded using ahigher than average bit rate and a tight bit rate control.

In principle the inventive apparatus is suited for decoding digitalvideo data which are stored on memory or recording means having a givendata storage capacity and allowing a variable instantaneous reading bitrate into decoding buffer means, using a chain of entropy decodingmeans, inverse quantiser means, inverse discrete cosine transform means,and adding means delivering the decoded output signal which is also fedto picture store means the output signal of which is provided to asecond input of said adding means, wherein said decoding buffer meansare controlled in the following way:

during a first part of said storage capacity the data is decoded using aslightly less than average decoder buffer means input bit rate andsignificantly higher than average allowable buffer filling levelvariations;

during a second part of said storage capacity the data is decoded usinga higher than average decoder buffer means input bit rate and less thanaverage allowable buffer filling level variations.

Advantageous additional embodiments of the inventive apparatuses areresulting from the respective dependent claims.

In principle, the inventive digital video signal is suited for storageon memory or recording means having a given data storage capacity andallowing a variable instantaneous storage bit rate, whereby

during a first part of said storage capacity the signal is encoded usinga slightly less than average bit rate and a significantly more loosethan average bit rate control;

during a second part of said storage capacity the signal is encodedusing a higher than average bit rate and a tight bit rate control.

Preferably, the inventive digital video signal is an MPEG2 or MPEG1 orH261 encoded video signal.

The inventive storage medium, in particular an optical disc, contains orhas recorded on it an inventive digital video signal.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred embodiments of the invention are described with reference tothe accompanying drawings, which show in:

FIG. 1 constant bit rate system;

FIG. 2 variable bit rate system;

FIG. 3 basic block diagram of MPEG encoder;

FIG. 4 basic block diagram of MPEG decoder;

FIG. 5 structure of a control loop;

FIG. 6 example functions for complexity over quantiser step size.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

In a CBR and in a VBR application the MPEG2 encoder MENC producesvariable bit rate data VBRD which is intermediately stored in theencoder buffer ENCB. The filling level of this buffer can be used tocontrol the coding process in MENC. At receiver side variable bit ratedata VBRD which is intermediately stored in the decoder buffer DECB arefed to an MPEG2 decoder MDEC. The reading of that data from DECB iscontrolled by MDEC.

In FIG. 1 the encoder buffer ENCB delivers a constant bit rate datastream CBR to the decoder buffer DECB. In FIG. 2, however, the encoderbuffer ENCB delivers a variable bit rate data stream VBR to the decoderbuffer DECB.

In FIG. 3 the encoder video data input signal IE includes macroblockdata to be encoded. In case of intraframe data a subtractor SUB simplypasses the data via discrete cosine transform computing means DCT andquantising means Q to entropy encoding means ECOD which may include ENCBand which deliver the encoder video data output signal OE.

In case of interframe data subtractor SUB subtracts predicted macroblockdata PMD from the input signal and passes the difference data viadiscrete cosine transform computing means DCT and quantising means Q toentropy encoding means ECOD. The output signal of Q is also fed toinverse quantising means Q_(E) ⁻¹ the output signal of which passesthrough inverse discrete cosine transform computing means DCT_(E) ⁻¹ toadder ADDE in the form of reconstructed macroblock difference data RMDD.The output signal of ADDE is intermediately stored in frame store andmotion compensation means FS_MC_E which also perform motion compensationon reconstructed macroblock data and which deliver such predictedmacroblock data PMD to SUB and to the other input of adder ADDE.

Quantising means Q, inverse quantising means Q_(E) ⁻¹, and ECOD arecontrolled by the filling level of encoder buffer ENCB in the inventiveway described above. It is also possible that FS_MC_E does not performmotion compensation.

The variable bit rate output to the storage medium can be done using themaximum possible bit rate while there is data available from the encoderbuffer, and can be suspended else.

In FIG. 4 the decoder video data input signal ID passes through entropydecoding means EDEC which may include DECB, inverse quantising meansQ_(D) ⁻¹, and inverse discrete cosine transform computing means DCT_(D)⁻¹ to an adder ADDD which delivers the decoder video data output signalOD. The output signal of ADDD is fed to frame store and motioncompensation means FS_MC_D which also perform motion compensation onreconstructed macroblock data and which in case of interframe macroblockdata deliver such predicted macroblock data PMD to the other input ofadder ADDE. In case of intraframe macroblock data the adder ADDD simplypasses the output signal of DCT_(D) ⁻¹.

Inverse quantising means Q_(D) ⁻¹ and EDEC are controlled according tothe kind of control for Q_(E) ⁻¹ and ECOD. Normally, in motioncompensation means FS_MC_D the same motion vector information is used asin motion compensation means FS_MC_E. It is also possible that FS_MC_Ddoes not perform motion compensation.

In order to handle situations of high bit rate demand, e.g. in case ofscene changes and complex scene content, the decoder buffer DECB isfilled from the storage medium with preferably the maximum possible bitrate. This can be done generally in case DECB is not full whereby nodata from the storage medium is stored into DECB if DECB is full. As analternative, DECB can be filled with a bit rate which corresponds to therespective bit rate when storing data on the memory or recording means.In either case the reading bit rate out of DECB corresponds to that whenencoding, i.e. the allowed and sometimes really occurring average bufferfilling level variations are greater in the first part (≈80%) of thetotal capacity and are less in the last part (≈20%) of the totalcapacity. “Average allowable buffer filling level variations” means thevariation over a length of some GOPs.

The invention can be used in any means like DVD, other optical ormagneto-optical or ferro-optical discs, electronic or optical RAM orROM, and magnetic tape systems which use a given capacity for storingvideo data.

The invention is not limited to MPEG2 encoders and decoders, but canalso be used with MPEG1 (ISO/IEC 11172-2), H261 (ISO/IEC), and othercoding and decoding methods in e.g. standard TV, HDTV, and videophoneapplications.

What is claimed is:
 1. A method for encoding a sequence of digital videodata to be stored, occupying a predetermined storage capacity on astorage medium, the storage medium allowing a variable instantaneousstorage bitrate, wherein the overall average bitrate of the digitalvideo data is said predetermined storage capacity divided by theduration of said sequence, comprising the steps: encoding said digitalvideo data stored in a first part of said predetermined storage capacityusing an average bitrate which is less than said overall average bitrateand using a loose instantaneous bitrate control; encoding said digitalvideo data in a remaining part of said predetermined storage capacityusing an average bitrate which is higher than said overall averagebitrate and using a tight instantaneous bitrate control.
 2. The methodaccording to claim 1, wherein: in said first part of said predeterminedstorage capacity said average data rate is about 95% of said overallaverage bit-rate and in said second part of said predetermined storagecapacity said average bitrate is about 150% of said overall average datarate.
 3. The method according to claim 1, wherein: said first part isabout 80% and said second part is about 20% of said predeterminedstorage capacity.
 4. The method according to claim 1, wherein: betweensaid first part and said second part of said predetermined storagecapacity there is a further part in which said bitrate control changessmoothly.
 5. A method for decoding a sequence of digital video dataoccupying a predetermined storage capacity on a storage medium, thestorage medium allowing a variable instantaneous reading bitrate intodecoding buffer means, wherein the overall average bitrate of digitalvideo data is said predetermined storage capacity divided by theduration of said sequence, comprising the steps: decoding said digitalvideo data stored in a first part of said predetermined storage capacityusing an average bitrate which is less than said overall average bitrateand corresponding to a loose instantaneous bit-rate control; decodingsaid digital video data in a remaining part of said predeterminedstorage capacity using an average bitrate which is higher than saidoverall average bitrate and corresponding to a tight instantaneousbitrate control.
 6. The method according to claim 2, wherein: in saidfirst part of said predetermined storage capacity said average data rateis about 95% of said overall average bit-rate and in said second part ofsaid predetermined storage capacity said average bitrate is about 150%of said overall average data rate.
 7. The method according to claim 2,wherein: said first part is about 80% and said second share is about 20%of said predetermined storage capacity.
 8. The method according to claim2, wherein: between said first part and said second part of saidpredetermined storage capacity there is a further part in which saidbitrate control changes smoothly.
 9. Apparatus for encoding a sequenceof digital video data to be stored, occupying a predetermined storagecapacity on a storage medium, the storage medium allowing a variableinstantaneous storage bitrate, wherein the overall average bitrate ofthe digital video data is said predetermined storage capacity divided bythe duration of said sequence, said apparatus comprising: an encodingloop including discrete cosine transform means: quantiser means: inversequantiser means: inverse discrete cosine transform means: picture storemeans; and entropy encoding means delivering the encoded output signaland being connected to the output of said quantiser means, wherein saidquantiser means, said inverse quantiser means, and said entropy encodingmeans encode said digital video data within a first share of saidpredetermined storage capacity using an average bitrate which is lessthan said overall average bitrate and using a loose instantaneousbitrate control and encode said digital video data within the remainingshare of said predetermined storage capacity using an average bitratewhich is higher than said overall average bitrate and using a tightinstantaneous bitrate control.
 10. Apparatus for decoding a sequence ofdigital video data occupying a predetermined storage capacity on astorage medium, the storage medium allowing a variable instantaneousreading bitrate into decoding buffer means wherein the overall averagebitrate of digital video data is said predetermined storage capacitydivided by the duration of said sequence, said apparatus comprising: achain of entropy decoding means; inverse quantiser means; inversediscrete cosine transform means; and adding means delivering the decodedoutput signal which is also fed to picture store means the output signalof which is provided to a second input of said adding means, whereinsaid decoding buffer means and said inverse quantiser means decode saiddigital video data within a first share of said predetermined storagecapacity using an average bitrate which is less than said overallaverage bitrate and corresponding to a loose instantaneous bit-ratecontrol and decode said digital video data within the remaining share ofsaid predetermined storage capacity using an average bitrate which ishigher than said overall average bitrate and corresponding to a tightinstantaneous bitrate control.
 11. An optical disk for storing encodedsequential digital video data wherein said encoded digital video dataoccupies a predetermined storage capacity on said optical disk, saidoptical disk allowing a variable instantaneous reading bitrate intodecoding buffer means, said digital video data including decodingcontrol information, wherein the overall average bitrate of the digitalvideo data is said predetermined storage capacity divided by theduration of a sequence, and wherein said digital video data stored in afirst part of said predetermined storage capacity is decoded using saidcontrol information and an average bitrate which is less than saidoverall average bitrate and corresponding to a loose instantaneousbit-rate control, and said digital video data in a remaining part ofsaid predetermined storage capacity is decoded using said controlinformation and an average bitrate which is higher than said overallaverage bitrate and corresponding to a tight instantaneous bitratecontrol.